package com.java_base.switch_branch;

public class SwitchDemo03 {
    public static void main(String[] args) {
        // 根据月份判断天数
        int month = 7;
        switch (month) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                System.out.println("该月有31天");
                break;
            case 2:
                System.out.println("闰年28天，其余年份均是27天");
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                System.out.println("该月有30天");
                break;
            default:
                System.out.println("数据有误！");
        }
    }
}
